package cloud.ben.smallscalepigfarmmanagementsystem.entity.pig;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.models.auth.In;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * @Author: Ben
 * @Date: 2022/3/31 16:46
 */
@ApiModel(description = "生猪表")
@Data
@TableName("pig")
@ToString
//@NoArgsConstructor
public class Pig {

    /**
     * id
     */
    @TableId(type = IdType.AUTO)
    @ApiModelProperty(required = true,value = "id")
    private Integer id;

    /**
     * 猪名
     */
    @ApiModelProperty(required = true,value = "猪名")
    @NotNull(message = "猪名为空")
    private String pigName;

    /**
     * 耳号
     */
    @ApiModelProperty(required = true,value = "耳号")
    @NotNull(message = "耳号为空")
    private Integer overBit;

    /**
     * 品种
     */
    @ApiModelProperty(required = true,value = "品种")
    @NotNull(message = "品种为空")
    private String variety;

    /**
     * 购入时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(required = true,value = "购入时间")
    @NotNull(message = "购入时间为空")
    private Date inTime;

    /**
     * 购入价格
     */
    @ApiModelProperty(required = true,value = "购入价格")
    @NotNull(message = "购入价格为空")
    private Double inPrice;

    /**
     * 父耳号
     */
    @ApiModelProperty(required = true,value = "父耳号")
    @NotNull(message = "父耳号为空")
    private Integer fatherOverBit;

    /**
     *母耳号
     */
    @ApiModelProperty(required = true,value = "母耳号")
    @NotNull(message = "母耳号为空")
    private Integer motherOverBit;

    /**
     *入保育舍时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(required = true,value = "入保育舍时间")
    @NotNull(message = "入保育舍时间为空")
    private Date inBreadTime;

    /**
     * 入育肥舍时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(required = true,value = "入育肥舍时间")
    @NotNull(message = "入育肥舍时间为空")
    private Date inFattenTime;

    /**
     * 死亡时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(required = true,value = "死亡时间")
    @NotNull(message = "死亡时间为空")
    private Date deathTime;

    /**
     * 售出时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(required = true,value = "售出时间")
    @NotNull(message = "售出时间为空")
    private Date sellTime;

    /**
     * 售价
     */
    @ApiModelProperty(required = true,value = "售价")
    @NotNull(message = "售价为空")
    private Double sellPrice;

    /**
     *售出客户编号
     */
    @ApiModelProperty(required = true,value = "售出客户编号")
    @NotNull(message = "售出客户编号为空")
    private Integer customerNumber;


    public Pig(Integer id, String pigName, Integer overBit, String variety, Date inTime, Double inPrice, Integer fatherOverBit, Integer motherOverBit, Date inBreadTime, Date inFattenTime, Date deathTime, Date sellTime, Double sellPrice, Integer customerNumber) {
        this.id = id;
        this.pigName = pigName;
        this.overBit = overBit;
        this.variety = variety;
        this.inTime = inTime;
        this.inPrice = inPrice;
        this.fatherOverBit = fatherOverBit;
        this.motherOverBit = motherOverBit;
        this.inBreadTime = inBreadTime;
        this.inFattenTime = inFattenTime;
        this.deathTime = deathTime;
        this.sellTime = sellTime;
        this.sellPrice = sellPrice;
        this.customerNumber = customerNumber;
    }


    public Pig(String pigName, Integer overBit, String variety, Date inTime, Double inPrice, Integer fatherOverBit, Integer motherOverBit, Date inBreadTime, Date inFattenTime, Date deathTime, Date sellTime, Double sellPrice, Integer customerNumber) {
        this.pigName = pigName;
        this.overBit = overBit;
        this.variety = variety;
        this.inTime = inTime;
        this.inPrice = inPrice;
        this.fatherOverBit = fatherOverBit;
        this.motherOverBit = motherOverBit;
        this.inBreadTime = inBreadTime;
        this.inFattenTime = inFattenTime;
        this.deathTime = deathTime;
        this.sellTime = sellTime;
        this.sellPrice = sellPrice;
        this.customerNumber = customerNumber;
    }


    public Pig() {
    }
}
